﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
 @section head{
        <style type="text/css">
            div#navigation{background:white}
            div#wrapper{float:right;width:100%;margin-left:-235px}
            div#content{margin-left:235px}
            div#navigation{float:left;width:230px}
            .datagrid-cell a{color:black;}
            .datagrid-cell a:hover{color:red;}
        </style>
}

@section scripts{
    <script src="~/Areas/Basic/ViewModels/basic.dwzd.js"></script>
    <script type="text/javascript">
        using(['validatebox','combobox']);
        var data = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model));
        ko.bindingViewModel(new viewModel(data));
    </script>
}

<div id="container">
    <div id="wrapper">
        <div id="content">
            <div class="z-toolbar">
                <a id="a_refresh" href="#" plain="true" class="easyui-linkbutton" icon="icon-arrow_refresh" title="刷新" data-bind="click:refreshClick">刷新</a>
                <a id="a_add" href="#" plain="true" class="easyui-linkbutton" icon="icon-add" title="新增" data-bind="click:addClick">新增</a>
                <a id="a_edit" href="#" plain="true" class="easyui-linkbutton" icon="icon-edit" data-bind="click:editClick" title="编辑">编辑</a>
                <a id="a_del" href="#" plain="true" class="easyui-linkbutton" icon="icon-cross" title="删除" data-bind="click:deleteClick">删除</a>
                <a id="a_save" href="#" plain="true" class="easyui-linkbutton" icon="icon-save" data-bind="click:saveClick" title="保存">保存</a>
                <a id="a_cus1" href="#" plain="true" class="easyui-linkbutton" icon="icon-node_tree" data-bind="click:typeClick" title="客户类别">客户类别</a>
            </div>

            <table id="gridlist" data-bind="datagrid:grid">
                <thead>
                    <tr>
                        <th field="Dwzd_Dwbh" sortable="true" align="left" width="80" editor="{type:'validatebox',options:{required:true}}">单位编号</th>
                        <th field="Dwzd_DWmc" sortable="true" align="left" width="135" editor="{type:'validatebox',options:{required:true}}">单位名称</th>
                        <th field="Dwzd_Dwjc" sortable="true" align="left" width="65" editor="text">单位简称</th>
                        <th field="Dwzd_Yzbm" sortable="true" align="left" width="80" editor="text">邮政编码</th>
                        <th field="Dwzd_Addr" sortable="true" align="left" width="120" editor="text">地址</th>
                        <th field="Dwzd_Bank" sortable="true" align="left" width="80" editor="text">开户银行</th>
                        <th field="Dwzd_BankCode" sortable="true" align="left" width="120" editor="text">银行账号</th>
                        <th field="Dwzd_Lxr" sortable="true" align="left" width="75"editor="text">联系人</th>
                        <th field="Dwzd_Lxdh" sortable="true" align="left" width="80" editor="text">电话</th>
                        <th field="Dwzd_Email" sortable="true" align="left" width="80" editor="text">Email</th>
                        <th field="Dwzd_Sh" sortable="true" align="left" width="90" editor="text">税号</th>
                        <th field="Dwzd_Fr" sortable="true" align="left" width="80" editor="text">法人</th>
                        <th field="Dwzd_Ywy" sortable="true" align="left" width="75" editor="text">业务员</th>
                        <th field="Dwzd_Sffc" sortable="true" align="center" width="60" editor="{type:'checkbox',options:{on:1,off:0}}" formatter="com.formatCheckbox">是否封存</th>
                        <th field="Dwzd_Remark" sortable="true" align="left" width="200" editor="text">备注</th>
                    </tr>
                </thead>
            </table>
        </div>
    </div>
    <div id="navigation">
        <div title="客户类别" style="width: 230px;" class="easyui-panel" data-options="title: '客户类别', iconCls: 'icon-node_tree', height: $(window).height() - 4 ">
            <ul data-bind="easyuiTree:tree"></ul>
        </div>
    </div>
</div>


<script type="text/html" id="type-template">

    <style type="text/css">
        .datagrid-wrap {
            border-width: 0 0 1px 0;
        }
    </style>

    <table data-bind="treegrid:grid">
        <thead>
        <th field="Dwlb_Lbbh" sortable="true" align="left" width="120" editor="{type:'validatebox',options:{required:true}}">类别编码</th>
        <th field="Dwlb_Lbmc" sortable="true" align="left" width="150" editor="{type:'validatebox',options:{required:true}}">类别名称</th>
        <th field="Dwlb_Sjbh" sortable="true" align="left" width="100" editor="text">上级编码   </th>
        <th field="Dwlb_Phx" sortable="true" align="left" width="60" editor="numberbox">排序号   </th>
        <th field="Dwlb_Remark" sortable="true" align="right" width="100" editor="text">备注       </th>
        </thead>
    </table>

    <div style="text-align:center;margin:5px;">
        <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" data-bind="click:confirmClick" href="javascript:void(0)">确定</a>
        <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" data-bind="click:cancelClick" href="javascript:void(0)">取消</a>
    </div>
</script> 
